package com.skyz.wrap.utils;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;

import com.hjq.toast.ToastUtils;

public class ClipboardManagerUtil {
    public static void copy(Context context,String text){
        ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        //设置内容到剪切板
        cm.setPrimaryClip(ClipData.newPlainText(null, text)) ;
        ToastUtils.show("复制成功");
    }
}
